package edu.tamu.cse.teamproject1.Database;

import java.util.Date;

/**
 * 
 * This is the subclass of TupleElement to represent a Date
 *
 * @author Benjamin Unsworth
 * @since Release 0.1.0
 */
public class TupleDateElement extends TupleElement {
	/**
	 * Constructor, defines the type and value of the TupleElement 
	 * @param value
	 */
	public TupleDateElement(Date value) {
		tupleValue = value;
		tupleType = EnumColumnType.date;
		size = 255;
	}
	
	/**
	 * Casts a value into a date and returns that date
	 * @return tupleValue, date of this tupleElement
	 */
	@Override
	public Date getValue(){
		return (Date)tupleValue;
	}
	
	/**
	 * Set the date of this tupleElement
	 * @param value
	 */
	@Override
	public void setValue(Object value){
		tupleValue = (Date)value;
	}
}
